All Questions
Tagged with programming-languagesc
75 questions
4votes
1answer
333views
What is the problem with whitespace in C that Ruby allegedly repeated?
I'm reading the book The Secret Life of Programs by Jonathan E. Steinhart. In it, he mentions in passing: many consider the handling of whitespace in Ruby to be a replay of of a mistake in the ...
0votes
1answer
235views
Is it true that variable type before name makes compiler work easier? [closed]
I have seen information that at least one of reasons why type placed before variable name is that it allows compiler easier evaluate size and type of variable. If so then how (what way) it eases this ...
2votes
1answer
2kviews
Why did Java and C sharply dip in popularity around 2017 in the TIOBE index? [closed]
The TIOBE Programming Community Index shows Java and C dramatically falling in popularity between late 2016 and mid 2017 before rebounding by mid 2018. What is the cause of the volatility? Source: www....
0votes
2answers
4kviews
Understanding Context Free Grammar using a simple C code
I'm trying to understand the difference between terminal and non-terminal values in a real language. I wasn't able to find enough examples on real language CFGs on the internet, most examples are ...
156votes
7answers
29kviews
Was the C programming language considered a low level language when it came out?
Currently C is considered a low level language, but back in the 70's was it considered low level? Was the term even in use then? Many popular higher level languages didn't exist until the mid 80's ...
2votes
4answers
4kviews
Why does C provide both the comma operator and the semicolon to separate statements?
Both the comma operator and the semicolon can be used to separate statements. Let's consider this simple code: #include <stdio.h> void do_something(int*i) {(*i)++;} int main() { int i; ...
12votes
3answers
10kviews
What is actually the difference between the GNU C Library and the C standard Library?
I sometimes see these two terms be used interchangeably. What is the actual difference between these two terms? How are they used differently? Are there any other alternatives to these two libraries?
1vote
1answer
240views
how to create API's from mere programming language
all programming languages have api's to interact various systems as a example javascript languge has Dom api to interact with the web page. C language languge has file access api to interact with ...
5votes
2answers
4kviews
Type safety - GO vs C pointers
C is a static-typed language that is not type-safe, because pointers(void *y) let you do pretty much anything you like, even things that will crash your program. GO is also a static typed language ...
-4votes
1answer
191views
Did GO embrace any language construct introduced in Java?
GO has embraced, 1) JavaScript/Python language constructs, Higher order function Closure Slicing Range operator Anonymous function(inner function) Provides abstractions ...
0votes
3answers
1kviews
Definition of Generic function
1) Below is a python function summation, that can perform sum of cubes/squares/.., similar operations. def identity(k): return k def cube(k): return pow(k, 3) def square(k): return ...
68votes
10answers
21kviews
Why do languages require parenthesis around expressions when used with "if" and "while"?
Languages like C, Java, and C++ all require parenthesis around an entire expression when used in an if, while, or switch. if (true) { // Do something } as opposed to if true { // Do ...
0votes
2answers
722views
How do I determine the visibility of "objects" as defined in the C programming language?
This question was asked by my professor in an exam and I couldn’t find an answer on Google, so here I am. I don't understand what objects are in C at all.
0votes
1answer
661views
Two C program sharing same addresses
I was trying to understand structure padding , so i wrote a simple program as written below and i executed it . just to make clear i made two copy of this program program1.c and program2.c and ...
1vote
4answers
3kviews
Why use a higher level language? [closed]
A question that gets asked a lot is "Why use low level languages if you can code in high level languages more easily (and often tersely)?". I think the answers are fairly straight forward here, being ...